package com.example.demo.po;

import com.example.demo.utils.BeanUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "USER")
@Data
//@Comment(value = "用户表测试")
@org.hibernate.annotations.Table(appliesTo = "user",comment = "用户信息表")
public class User extends AuditEntity{

    @ApiModelProperty(value = "用户编号")
    @Column(name = "user_number",columnDefinition = "varchar(32) comment '用户编号'")
    private String userNumber;

    @ApiModelProperty(value = "用户名称")
    @Column(name = "user_name",columnDefinition = "varchar(512) comment '用户名称'")
    private String userName;

    @ApiModelProperty(value = "用户密码")
    @Column(name = "pass_word",columnDefinition = "varchar(125) comment '用户密码'")
    private String passWord;

    @ApiModelProperty(value = "用户地址")
    @Column(name = "address",columnDefinition = "varchar(512) comment '用户地址'")
    private String address;

    @ApiModelProperty(value = "联系方式")
    @Column(name = "phone",columnDefinition = "varchar(20) comment '联系方式'")
    private String phone;

    public void copy(User user) {
        BeanUtils.beanCopyWithIngore(user, this);
    }
}
